package com.ng.common.util;

import java.util.regex.Pattern;
import lombok.experimental.UtilityClass;

@UtilityClass
public class XssUtil {
	private static final Pattern XSS_PATTERN = Pattern.compile("<.*?>");

	// 检查给定的值是否存在 XSS 风险
	public boolean containsXss(String value) {
		return value != null && XSS_PATTERN.matcher(value).find();
	}

}
